home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / thor12.zip / THOR.LHA / rexx / getcommandinfo.thor < prev    next >
Text File  |  1994-03-03  |  1KB  |  50 lines

  1. /*
  2. **  getcommandinfo.thor - will return all available ARexx commands in THOR
  3. **                          to the sender, or the template to a single command
  4. **
  5. **    Will return 10 if the command given was not known to THOR. 0 on all
  6. **    other cases.
  7. **
  8. **    Template:
  9. **
  10. **    COMMAND=CMD,STEM/A
  11. **
  12. **    STEM is the stem variable THOR will but the result into, and it must be
  13. **    supplied or this command will fail.  The stem variable must be in 
  14. **    uppercase.
  15. **    If COMMAND is used, THOR will return the template for that command in 
  16. **    the given STEM variable.
  17. **    If COMMAND is not given, THOR will return the following:
  18. **
  19. **    <stem>.COUNT        -    the number of commands
  20. **    <stem>.n            -    n is a number which will not exceed <stem>.COUNT
  21. **                            and contains the command
  22. **    <stem>.n.TEMPLATE    -    n is a number which will not exceed <stem>.COUNT
  23. **                            and contains the template for the command
  24. **
  25. */
  26.  
  27. address "THOR.01"
  28.  
  29. GETCOMMANDINFO cmd GETCONFLIST stem TEMP
  30.  
  31. if(rc = 0) then say TEMP
  32.  
  33. GETCOMMANDINFO stem INFO
  34.  
  35. if(rc ~= 0) then exit
  36.  
  37. i = INFO.COUNT
  38.  
  39. say "The number of ARexx commands in THOR:" INFO.COUNT
  40.  
  41. n = 1
  42. DO while i > 0 & n <= i
  43.     say "Command :" INFO.n
  44.     say "Template:" INFO.n.TEMPLATE
  45.     n = n + 1
  46. END
  47.  
  48. exit
  49.  
  50.